<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>魔方</title>
    <link rel="icon" href="./img/logo_32.ico">
    <style>
        html {
            background-color: black;
            height: 100%;
        }
        /* 最外层容器样式 */
        
        .wrap {
            width: 200px;
            height: 200px;
            /* background-color: blue; */
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            margin: auto;
        }
        /* 包裹所有容器的样式 */
        
        .cube {
            width: 200px;
            height: 200px;
            margin: 0 auto;
            /* 使容器内所有元素具有3d空间效果 */
            transform-style: preserve-3d;
            animation: rotate 20s infinite;
            animation-timing-function: linear;
        }
        
        @keyframes rotate {
            form {
                transform: rotateX(0deg) rotateY(0deg);
            }
            to {
                transform: rotateX(360deg) rotateY(360deg);
            }
        }
        
        .cube div {
            width: 200px;
            height: 200px;
            position: absolute;
            opacity: 0.8;
            transition: all 0.4s;
        }
        /* 给所有图片设置大小 */
        
        .pic {
            width: 200px;
            height: 200px;
        }
        
        .cube .out_front {
            transform: rotateY( 0deg) translateZ(100px);
        }
        
        .cube .out_back {
            transform: translateZ(-100px) rotateY( 180deg);
        }
        
        .cube .out_left {
            transform: rotateY( 90deg) translateZ(100px);
        }
        
        .cube .out_right {
            transform: rotateY( -90deg) translateZ(100px);
        }
        
        .cube .out_top {
            transform: rotateX( 90deg) translateZ(100px);
        }
        
        .cube .out_bottom {
            transform: rotateX( -90deg) translateZ(100px);
        }
        
        .pic {
            width: 200px;
            height: 200px;
        }
        
        .cube span {
            width: 100px;
            height: 100px;
            position: absolute;
            top: 50px;
            left: 50px;
        }
        
        .in_pic {
            width: 100px;
            height: 100px;
        }
        
        .cube .in_front {
            transform: rotateY(0deg) translateZ(50px);
        }
        
        .cube .in_back {
            transform: translateZ(-50px) rotateY(180deg);
        }
        
        .cube .in_left {
            transform: rotateY(90deg) translateZ(50px);
        }
        
        .cube .in_right {
            transform: rotateY(-90deg) translateZ(50px);
        }
        
        .cube .in_top {
            transform: rotateX(90deg) translateZ(50px);
        }
        
        .cube .in_bottom {
            transform: rotateX(-90deg) translateZ(50px);
        }
        
        .cube:hover .out_front {
            transform: rotateY(0deg) translateZ(200px);
        }
        
        .cube:hover .out_back {
            transform: translateZ(-200px) rotateY(180deg);
        }
        
        .cube:hover .out_left {
            transform: rotateY(90deg) translateZ(200px);
        }
        
        .cube:hover .out_right {
            transform: rotateY(-90deg) translateZ(200px);
        }
        
        .cube:hover .out_top {
            transform: rotateX(90deg) translateZ(200px);
        }
        
        .cube:hover .out_bottom {
            transform: rotateX(-90deg) translateZ(200px);
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div class="cube">
            <div class="out_front">
                <img src="./img/cp01.jpg" alt="" class="pic">
            </div>
            <div class="out_back">
                <img src="./img/cp02.jpg" alt="" class="pic">
            </div>
            <div class="out_left">
                <img src="./img/cp03.jpg" alt="" class="pic">
            </div>
            <div class="out_right">
                <img src="./img/cp04.jpg" alt="" class="pic">
            </div>
            <div class="out_top">
                <img src="./img/cp05.jpg" alt="" class="pic">
            </div>
            <div class="out_bottom">
                <img src="./img/cp06.jpg" alt="" class="pic">
            </div>
            <span class="in_front">
                <img src="./img/cp07.jpg" alt="" class="in_pic">
            </span>
            <span class="in_back">
                <img src="./img/cp08.jpg" alt="" class="in_pic">
            </span>
            <span class="in_left">
                <img src="./img/cp09.jpg" alt="" class="in_pic">
            </span>
            <span class="in_right">
                <img src="./img/cp10.jpg" alt="" class="in_pic">
            </span>
            <span class="in_top">
                <img src="./img/cp11.jpg" alt="" class="in_pic">
            </span>
            <span class="in_bottom">
                <img src="./img/cp12.jpg" alt="" class="in_pic">
            </span>
        </div>
    </div>
</body>

</html>